package com.project.controller;

import com.project.entity.CarGoods;
import com.project.entity.Purchase;
import com.project.entity.Result;
import com.project.entity.User;
import com.project.service.CarGoodsService;
import com.project.service.PurchaseService;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/purchase")
public class PurchaseController {
    @Autowired
    private PurchaseService purchaseService;

    @PostMapping("save")
    public Result save(Purchase purchase) {
        Result result = new Result();
        try {
            purchaseService.save(purchase);
            result.success("成功");
        }catch (Exception e){
            e.printStackTrace();
        }

        return result;
    }


}
